Reporting on Link Module Descriptors

Hi

I have a problem with the perm getLinkModuleDescriptorsExclusive in the script shown below. I've scanned a previous thread with the same title dating from September 6 2012. The usual wise men contributed but seemed to conclude there was a bug.

The purpose of the code is to identify any modules in a project that do not have the check box 'Only allow outgoing links as specified in the above list' checked.

Without the offending perm the script loops through all modules in a project reporting on the linksets. When the perm is present the script only reports on the first module in each folder. The project is organised with formal modules in folders below the project.

I'm using DOORS 8.1 and the perm is undocumented in the DXL help. I know that using undocumented perms carries a risk. Can anyone suggest another method of finding whether this check box is set?

Thanks for reading

Jim B

// Variable declarations

string str1

Item itmCur
Folder fldrCur
Project prjCur = current

// function declarations

void jbfn_linksetReporter(Folder)

for itmCur in prjCur do{
    str1 = type(itmCur)
    if (str1 == "Folder"){
        fldrCur = folder(itmCur)
        jbfn_linksetReporter(fldrCur)
    }
}

print "All done.\n"

void jbfn_linksetReporter(Folder fldr) {
    bool found = false, exFlag = false
    string str1, str2, str3, str4, str5
// buffer used in conjunction with boolean 'found' to prevent printing folder names when no linksets defined
    Buffer buff1 = create()
    LinkModuleDescriptor lnkModDes
    buff1 = "Current folder is: " name(fldr) "\n"
    for lnkModDes in fldr do {
        found = true
        str1 = getName(lnkModDes)
// getDescription is not returning any information so omit it
//        str2 = getDescription(lnkModDes)
        str3 = getSourceName(lnkModDes)
print "** " str3 "\n"
        str4 = getTargetName(lnkModDes)
        exFlag = getLinkModuleDescriptorsExclusive(fldr, module( str3) )
//        mand = getMandatory(lnkModDes)
//        str5 = mand ""
        str5 = upper( exFlag "" )

        buff1 += "Link Module \t\t" str1 "\n"
        buff1 += "\tSource Mod. \t" str3 "\n"
        buff1 += "\tTarget Mod. \t" str4 "\n"
        buff1 += str5 "\n\n"
    }
    if (found){
        print buff1 ""
        print "\n"
    }
    delete buff1
}


bmij - Tue Dec 10 10:49:40 EST 2013

Re: Reporting on Link Module Descriptors
GregM_dxler - Wed Dec 11 09:32:37 EST 2013

Hi,

Sorry, I don't have DOORS 8.1.  getLinkModuleDescriptorsExclusive is documented in DOORS 9.3 dxl help.  The passed arguments to it are the folder and ModName_.  In the operation, it states the specified document must be a child of the specified folder.  In looking at your code, it finds the source module for the linkset, but that doesn't seem to necessarily say the source will be a child of the folder.  That might be where it is hiccupping.

Wouldn't it be easier to just loop through the folders, find the formal modules and do the check on the module then?  That way, the module would be a child of the folder.

Hope this helps,

Greg

Re: Reporting on Link Module Descriptors
bmij - Thu Dec 12 06:59:46 EST 2013

GregM_dxler - Wed Dec 11 09:32:37 EST 2013

Hi,

Sorry, I don't have DOORS 8.1.  getLinkModuleDescriptorsExclusive is documented in DOORS 9.3 dxl help.  The passed arguments to it are the folder and ModName_.  In the operation, it states the specified document must be a child of the specified folder.  In looking at your code, it finds the source module for the linkset, but that doesn't seem to necessarily say the source will be a child of the folder.  That might be where it is hiccupping.

Wouldn't it be easier to just loop through the folders, find the formal modules and do the check on the module then?  That way, the module would be a child of the folder.

Hope this helps,

Greg

Greg, thanks for your comments, in particular pointing me to the documentation in later versions of DOORS. IBM have added it between 8.3 and 9.2. As I was working with DOORS 9.x until recently I have access to the reference manual.

After various attempts I'm making progress but priority of other tasks may prevent me finishing it.

I suspect that while the linksets are stored in the parent folder that the setting 'Only allow outgoing links ...' is stored in the module. The perm 'for module in folder' only works for open modules whereas the 'for linkset in folder' is not working with modules so it doesn't matter whether they are open or not. When the module is open getLinkModuleDescriptorsExclusive appears to be working correctly.

A version of the script without getLinkModuleDescriptorsExclusive correctly reports defined linksets.

Jim B